﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter08.Code02
{
    public class Demo
    {
        public static void Begin()
        {
            {
                using (CupOfCoffee cupOfCoffiee = new CupOfCoffee())
                {

                }
            }
            {
                Cow myCow = new Cow();
                Chicken myChicken = new Chicken();
                myCow.EatFood();
                myChicken.EatFood();
                Animal myAnimal = myCow;
                myAnimal.EatFood();
                Cow myNewCow = (Cow)myAnimal;
                myNewCow.Moo();
            }
            {
                Cow myCow = new Cow();
                Chicken myChieck = new Chicken();
                IConsume consumeInterface;
                consumeInterface = myCow;
                consumeInterface.EatFood();
                consumeInterface = myChieck;
                consumeInterface.EatFood();
            }
            {
                VenusFlyTrap myVenusFlyTarap = new VenusFlyTrap();
                IConsume consumeInterface;
                consumeInterface = myVenusFlyTarap;
                consumeInterface.EatFood();
            }
            {
                Animal[] animals = new Animal[5];
            }
            {
                if (new Cow().Weight > new Cow().Weight)
                {
                    //...
                }
                
            }
            {
                var cowA = new Cow();
                var cowB = new Cow();
                if (cowA < cowB)
                {
                    //...
                }
            }
        }
    }
}
